package com.example.food_contract_system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.food_contract_system.domain.Status;
import com.example.food_contract_system.mapper.StatusMapper;
import com.example.food_contract_system.service.StatusService;
import com.example.food_contract_system.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author LiHaoyang
 * @date 2023/7/7  12:15
 **/
@Service
public class StatusServiceImpl extends ServiceImpl<StatusMapper, Status> implements StatusService {

    @Autowired
    private StatusMapper statusMapper;

    @Override
    public R getUserStatus() {
        List<Status> statusList = statusMapper.selectList(null);
        if (statusList.size() > 0){
            return R.ok().put("data",statusList);
        }
        return R.error();
    }
}
